package com.hngates.architecture.service.impl;

import java.util.List;
import com.hngates.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hngates.architecture.mapper.ArcLabourContractMapper;
import com.hngates.architecture.domain.ArcLabourContract;
import com.hngates.architecture.service.IArcLabourContractService;
import com.hngates.common.core.text.Convert;

/**
 * 劳务合同Service业务层处理
 * 
 * @author jwhe
 * @date 2022-07-04
 */
@Service
public class ArcLabourContractServiceImpl implements IArcLabourContractService 
{
    @Autowired
    private ArcLabourContractMapper arcLabourContractMapper;

    /**
     * 查询劳务合同
     * 
     * @param id 劳务合同主键
     * @return 劳务合同
     */
    @Override
    public ArcLabourContract selectArcLabourContractById(Long id)
    {
        return arcLabourContractMapper.selectArcLabourContractById(id);
    }

    /**
     * 查询劳务合同列表
     * 
     * @param arcLabourContract 劳务合同
     * @return 劳务合同
     */
    @Override
    public List<ArcLabourContract> selectArcLabourContractList(ArcLabourContract arcLabourContract)
    {
        return arcLabourContractMapper.selectArcLabourContractList(arcLabourContract);
    }

    /**
     * 新增劳务合同
     * 
     * @param arcLabourContract 劳务合同
     * @return 结果
     */
    @Override
    public int insertArcLabourContract(ArcLabourContract arcLabourContract)
    {
        arcLabourContract.setCreateTime(DateUtils.getNowDate());
        return arcLabourContractMapper.insertArcLabourContract(arcLabourContract);
    }

    /**
     * 修改劳务合同
     * 
     * @param arcLabourContract 劳务合同
     * @return 结果
     */
    @Override
    public int updateArcLabourContract(ArcLabourContract arcLabourContract)
    {
        arcLabourContract.setUpdateTime(DateUtils.getNowDate());
        return arcLabourContractMapper.updateArcLabourContract(arcLabourContract);
    }

    /**
     * 批量删除劳务合同
     * 
     * @param ids 需要删除的劳务合同主键
     * @return 结果
     */
    @Override
    public int deleteArcLabourContractByIds(String ids)
    {
        return arcLabourContractMapper.deleteArcLabourContractByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除劳务合同信息
     * 
     * @param id 劳务合同主键
     * @return 结果
     */
    @Override
    public int deleteArcLabourContractById(Long id)
    {
        return arcLabourContractMapper.deleteArcLabourContractById(id);
    }

    @Override
    public ArcLabourContract selectArcLabourContractById(Long projectId, Long labourCompanyId, Long labourSubCompanyId) {
        return arcLabourContractMapper.selectArcLabourContractByIds(projectId,labourCompanyId,labourSubCompanyId);

    }
}
